*/
private $copyrightUrl;
+ /** @var array Profiling data */
+ private $limitReportData = [];
+
/**
* Constructor for OutputPage. This should not be called directly.
* Instead a new RequestContext should be created and it will implicitly create
$this->mModuleStyles = array_merge( $this->mModuleStyles, (array)$modules );
}
- /**
- * Get the list of module messages to include on this page
- *
- * @deprecated since 1.26 Obsolete
- * @param bool $filter
- * @param string|null $position
- * @return array Array of module names
- */
- public function getModuleMessages( $filter = false, $position = null ) {
- wfDeprecated( __METHOD__, '1.26' );
- return [];
- }
-
- /**
- * Load messages of one or more ResourceLoader modules.
- *
- * @deprecated since 1.26 Use addModules() instead
- * @param string|array $modules Module name (string) or array of module names
- */
- public function addModuleMessages( $modules ) {
- wfDeprecated( __METHOD__, '1.26' );
- }
-
/**
* @return null|string ResourceLoader target
*/
}
/**
- * Add or replace an header item to the output
+ * Add or replace a head item to the output
*
* Whenever possible, use more specific options like ResourceLoader modules,
* OutputPage::addLink(), OutputPage::addMetaLink() and OutputPage::addFeedLink()
$this->mHeadItems[$name] = $value;
}
+ /**
+ * Add one or more head items to the output
+ *
+ * @since 1.28
+ * @param string|string[] $value Raw HTML
+ */
+ public function addHeadItems( $values ) {
+ $this->mHeadItems = array_merge( $this->mHeadItems, (array)$values );
+ }
+
/**
* Check if the header item $name is already set
*
}
}
- // enable OOUI if requested via ParserOutput
+ // Enable OOUI if requested via ParserOutput
if ( $parserOutput->getEnableOOUI() ) {
$this->enableOOUI();
}
+ // Include profiling data
+ $this->setLimitReportData( $parserOutput->getLimitReportData() );
+
// Link flags are ignored for now, but may in the future be
// used to mark individual language links.
$linkFlags = [];
* @return string
*/
function getBottomScripts() {
- return $this->getScriptsForBottomQueue();
+ return $this->getScriptsForBottomQueue() .
+ ResourceLoader::makeInlineScript(
+ ResourceLoader::makeConfigSetScript(
+ [ 'wgPageParseReport' => $this->limitReportData ],
+ true
+ )
+ );
}
/**
) {
// We're on a preview of a CSS subpage
// Exclude this page from the user module in case it's in there (bug 26283)
- $link = $this->makeResourceLoaderLink( 'user', ResourceLoaderModule::TYPE_STYLES,
+ $link = $this->makeResourceLoaderLink( 'user.styles', ResourceLoaderModule::TYPE_STYLES,
[ 'excludepage' => $this->getTitle()->getPrefixedDBkey() ]
);
$otherTags = array_merge( $otherTags, $link['html'] );
$otherTags[] = Html::inlineStyle( $previewedCSS );
} else {
// Load the user styles normally
- $moduleStyles[] = 'user';
+ $moduleStyles[] = 'user.styles';
}
// Per-user preference styles
// public API or you'll be severely disappointed when T87871 is fixed and it disappears.
$this->addMeta( 'X-OOUI-PHP', '1' );
}
+
+ /**
+ * @param array $data Data from ParserOutput::getLimitReportData()
+ * @since 1.28
+ */
+ public function setLimitReportData( array $data ) {
+ $this->limitReportData = $data;
+ }
}